-
Notifications
You must be signed in to change notification settings - Fork 30
overridable: Implement for custom fields #298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
palkerecsenyi
wants to merge
6
commits into
inveniosoftware:master
Choose a base branch
from
palkerecsenyi:custom-field-overridable
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
overridable: Implement for custom fields #298
palkerecsenyi
wants to merge
6
commits into
inveniosoftware:master
from
palkerecsenyi:custom-field-overridable
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* This commit demonstrates a potential method of implementing `Overridable` support for custom fields. * When creating a custom field [UI definition](https://inveniordm.docs.cern.ch/customize/metadata/custom_fields/records/#upload-deposit-form), the user simply has to specify an additional `id` prop with their desired ID value for the Overridable. Then, they can specify a `parametrize` in the `overridableRegistry/mapping.js` as usual. * The aim is to have a set of common props that can be applied to all the field widgets, similarly to inveniosoftware/invenio-app-rdm#3103. * This commit makes the necessary changes to two of the UI widgets as a demonstration. When parameterizing, the user has to reference e.g. `AutocompleteDropdownComponent` instead of `AutocompleteDropdown`. These are both exported.
* fieldComponents contains some helpers that are used by field components in other Invenio modules such as `invenio-app-rdm` and `invenio-vocabularies`. In the future, it may also be used by custom field implementors. * This commit exports it at the top level of the package
This was referenced Jul 17, 2025
palkerecsenyi
added a commit
to palkerecsenyi/docs-invenio-rdm
that referenced
this pull request
Jul 18, 2025
* As part of inveniosoftware/react-invenio-forms#298, UI widgets are being given a standardised common set of props (on top of which each widget can have additional, more specific props) * This PR changes the reference docs for custom field widgets by splitting into the two distinct sections of "common props" and "widget-specific props"
palkerecsenyi
added a commit
to palkerecsenyi/docs-invenio-rdm
that referenced
this pull request
Jul 18, 2025
* As part of inveniosoftware/react-invenio-forms#298, UI widgets are being given a standardised common set of props (on top of which each widget can have additional, more specific props) * This PR changes the reference docs for custom field widgets by splitting into the two distinct sections of "common props" and "widget-specific props"
* Implemented the standardised props and dynamic-ID overridable wrapper for all the UI widgets available for use in custom widgets.
9baaeb9
to
ac1ebf6
Compare
palkerecsenyi
added a commit
to palkerecsenyi/invenio-app-rdm
that referenced
this pull request
Jul 25, 2025
* Added an injection of the field ID (e.g. `cern:department`) to the React UI widget chosen for the custom field via a new `id` prop. * This is consumed by the new function in inveniosoftware/react-invenio-forms#298 and used to allow developers to dynamically parametrize their own custom fields based on the form state. * This is not a breaking change and shouldn't affect any existing custom fields
palkerecsenyi
added a commit
to palkerecsenyi/invenio-app-rdm
that referenced
this pull request
Jul 25, 2025
* Added an injection of the field ID (e.g. `cern:department`) to the React UI widget chosen for the custom field via a new `id` prop. * This is consumed by the new function in inveniosoftware/react-invenio-forms#298 and used to allow developers to dynamically parametrize their own custom fields based on the form state. * This is not a breaking change and shouldn't affect any existing custom fields
palkerecsenyi
added a commit
to palkerecsenyi/invenio-app-rdm
that referenced
this pull request
Jul 25, 2025
* Added an injection of the field ID (e.g. `cern:department`) to the React UI widget chosen for the custom field via a new `id` prop. * This is consumed by the new function in inveniosoftware/react-invenio-forms#298 and used to allow developers to dynamically parametrize their own custom fields based on the form state. * This is not a breaking change and shouldn't affect any existing custom fields
* Added helpText support for the generic SelectField * Ensured Dropdown and AutoComplete handle helpText and disabled props correctly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #297
This is a draft proposal of a solution for this issue, please let me know if you have any suggestions on how to better implement it.
Description
This commit demonstrates a potential method of implementing
Overridable
support for custom fields.When creating a custom field UI definition, the user simply has to specify an additional
id
prop with their desired ID value for the Overridable. Then, they can specify aparametrize
in theoverridableRegistry/mapping.js
as usual.The aim is to have a set of common props that can be applied to all the field widgets, similarly to
Ensure consistent use of
Overridable
in deposit form invenio-app-rdm#3103.This commit makes the necessary changes to two of the UI widgets as a demonstration. When parameterizing, the user has to reference e.g.
AutocompleteDropdownComponent
instead ofAutocompleteDropdown
. These are both exported.On its own, this feature is not helpful: users could simply change the props they assign in the Python dictionary instead of using an override. Instead, this is intended to be used in conjunction with
dynamicParametrize
(created in overridable: add dynamicParametrize function #300) to allow users to dynamically change the props of their custom fields based on the form state.Full example
In the custom fields definitions file:
Then, in
assets/js/invenio_app_rdm/overridableRegistry/mapping.js
: